{% extends 'home/base_right.html' %}
{% import "ui/admin_page.html" as pg %}

{% block banner_left %}{% endblock %}
{% block banner_right %}{% endblock %}
{% block posts_list %}
    <!--博客列表-->
    <h1 class="t_nav">
        <span>不要轻易放弃。学习成长的路上，我们长路漫漫，只因学无止境。 </span>
        <a href="/" class="n1">网站首页</a>
        {% if cate_id == 2 or cate_id == 5 or cate_id == 8 %}
            <a href="{{ url_for('home.show_first_cate',keyword='life',page=1) }}" class="n2">慢生活</a>
        {% else %}
            <a href="{{ url_for('home.show_first_cate',keyword='work',page=1) }}" class="n2">学无止境</a>
        {% endif %}
        <a href="{{ url_for('home.show_cate',keyword=cate_id,page=1) }}" class="n3">{{ second_category }}</a>
    </h1>
    <div class="blogsbox">
        {% for post in page_data.items %}
            <div class="blogs" data-scroll-reveal="enter bottom over 1s">
                <h3 class="blogtitle"><a href="{{ url_for('home.show_post',post_id=post.id) }}">{{ post.title }}</a>
                </h3>
                <span class="blogpic">
                    <a href="{{ url_for('home.show_post',post_id=post.id) }}" title="">
                        {% if post.id % 2 == 0 %}
                            <img src="{{ url_for('static',filename='home/images/toppic01.jpg') }}" alt="">
                        {% else %}
                            <img src="{{ url_for('static',filename='home/images/toppic02.jpg') }}" alt="">
                        {% endif %}
                    </a>
                </span>
                <p class="blogtext">{{ post.body|striptags|truncate(40) }}</p>
                <div class="bloginfo">
                    <ul>
                        <li class="author">
                            <a href="{{ url_for('home.about_me') }}">段少强</a>
                        </li>
                        <li class="lmname">
                            <a href="{{ url_for('home.show_cate',keyword=post.category_id,page=1) }}">{{ post.category.name }}</a>
                        </li>
                        <li class="timer">{{ post.timestamp }}</li>
                        <li class="view"><span>{{ post.read_num }}</span>已阅读</li>
                        <li class="like">{{ post.like_num }}</li>
                    </ul>
                </div>
            </div>
        {% endfor %}
        <div style="text-align: center;">
            {{ pg.page(page_data, "home.show_cate",cate_id) }}
        </div>
    </div>
{% endblock %}